<template>
  <div id="detailPage">
    <div class="detailPage-hed">
      <p
        @click="changeTab(index, v.id)"
        :class="{ active: index === number }"
        v-for="(v, index) in list"
        :key="index"
        >{{ v.name }}</p
      >
    </div>
  </div>
</template>
<script>
import { showModuleName } from '@/utils/homeConfig'
export default {
  data() {
    return {
      list: [
        {
          name: showModuleName('tzgg') || '通知公告',
          id: 1,
        },
        {
          name: showModuleName('zcfg') || '政策法规',
          id: 2,
        },
        {
          name: '关于我们',
          id: 3,
        },
        {
          name: '联系我们',
          id: 4,
        },
      ],
      number: 0,
      listId: '',
      listType: '',
    }
  },

  watch: {
    $route(to, from) {
      this.number = Number(this.$route.query.listType) - 1
      var type = this.$route.query.listType
    },
  },
  mounted() {
    this.number = Number(this.$route.query.listType) - 1
  },
  methods: {
    changeTab(index, id) {
      this.number = index
      this.show = true
      this.$router.push({
        path: '../newsPage',
        query: { type: 8, listType: id },
      })
    },
    clickShow(item) {
      this.listType = item.listType
      this.show = item.show
      this.listId = item.id
    },
  },
}
</script>
<style  lang="scss" >
</style>